<!DOCTYPE html>
<html lang="zh-CN">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
  <style>
    div {
      position: relative;
      top: 0;
      left: 0;
      width: 300px;
      height: 300px;
      margin: 100px auto;

      /* 在 3D 空间中显示子元素 */
      transform-style: preserve-3d;
      /* 透视视距：一般取 800px → 1200px */
      perspective: 1000px;

      transition: all 1s;
    }

    div:hover {
      transform: rotateX(60deg);
    }

    div>img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
    }

    div>img:nth-child(1) {
      transform: translateZ(-100px);
    }

    div>img:nth-child(2) {
      transform: translateZ(100px);
    }
  </style>
</head>

<body>
  <div>
    <img src="../assets/images/Cheems.jpg">
    <img src="../assets/images/Cheems.jpg">
  </div>
</body>

</html>